Bugfix WiFiGeneric - SoftAP DHCPServer Corrupt Log Entry #6719
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Fixes corrupt log entry printed by SoftAP DHCPServer. Converts String() to expected cstr format.
I noticed while testing AP mode that the DHCP Server log prints random trash for the end of the IP address range. This is because a
String
is passed to a parameter expecting acstr
.The relevant line is WiFiGeneric.cpp:154:
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString(), IPAddress(lease.end_ip.addr).toString());
Should be:
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString().c_str(), IPAddress(lease.end_ip.addr).toString().c_str());
I also searched the entirety of framework-arduinoespressif32 (PIO's copy of arduino-esp32) and verified that toString() is being used properly in all other files.
Tests scenarios
Tested fix on Adafruit Feather ESP32
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.3/platform-espressif32-2.0.3.zip
Related links
No related issues